package com.alex.utils.http;

import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;

import com.alex.utils.http.cache.HttpCacheProvider;

public class RequestBuilderFactory {

	private HttpClient httpClient;
	
	private HttpCacheProvider cacheProvider;
	
	public RequestBuilderFactory(HttpClient httpClient) {
		this.httpClient = httpClient;
	}
	
	public void setCacheProvider(HttpCacheProvider cacheProvider) {
		this.cacheProvider = cacheProvider;
	}

	public RequestBuilder get(String url) {
		return new RequestBuilder(new HttpGet(url), httpClient).cache(cacheProvider);
	}

	public RequestBuilder post(String url) {
		return new RequestBuilder(new HttpPost(url), httpClient);
	}
}
